package com.mccken.springframework.beans.factory.support;

import com.mccken.springframework.core.io.DefaultResourceLoader;
import com.mccken.springframework.core.io.ResourceLoader;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2022-11-30 14:50
 **/
public abstract class AbstractBeanDefinitionReader implements BeanDefinitionReader {
	// bean定义的注册中心
	private final BeanDefinitionRegistry registry;
	
	private ResourceLoader resourceLoader;
	
	public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry, ResourceLoader resourceLoader) {
		this.registry = registry;
		this.resourceLoader = resourceLoader;
	}
	
	protected AbstractBeanDefinitionReader(BeanDefinitionRegistry registry) {
		this(registry, new DefaultResourceLoader());
	}

	@Override
	public BeanDefinitionRegistry getRegistry() {
		return this.registry;
	}

	@Override
	public ResourceLoader getResourceLoader() {
		return this.resourceLoader;
	}
}
